package br.org.etec.dotcao.model;

import static javax.persistence.CascadeType.MERGE;
import static javax.persistence.CascadeType.PERSIST;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

@Table(name="taddress")
@Entity
@XmlRootElement
public class Address extends AbstractEntity {
	
	private static final long serialVersionUID = 1L;

	@Column
	private String street;

	@Column
	private String number;

	@Column
	private String neighborhood;

	@ManyToOne(cascade={PERSIST, MERGE})
	@JoinColumn(name="city")
	private City city;
	
	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getNeighborhood() {
		return neighborhood;
	}

	public void setNeighborhood(String neighborhood) {
		this.neighborhood = neighborhood;
	}

	public City getCity() {
		return city;
	}

	public void setCity(City city) {
		this.city = city;
	}
}
